<template>
	<view style="position: sticky; top: 0rpx;z-index: 9999;">
		<!-- 与包裹页面所有内容的元素u-page同级，且在它的下方 -->
		<u-tabbar active-color="#F9A825" :value="current ? current : 0" :list="list" :mid-button="true"
			@change='tabbarChange'></u-tabbar>
	</view>
</template>

<script>
export default {
	name: "diyTabbar",
	props: {
		current: Number
	},
	data() {
		return {
			list: [{
				iconPath: "https://s3.dova.link:3001/test/20240202/dd9154fa970c4a8e8e7c6a4d49bccfc3.png",
				selectedIconPath: "https://s3.dova.link:3001/test/20240202/28155869ca074f70835c589e43a3e668.png",
				text: '首页',
				// count: 2,
				// isDot: true,  //显示微标
				customIcon: false,
			},
			{
				iconPath: "https://s3.dova.link:3001/test/20240204/d7d94d3d0e6b4459908b9f766547e0d3.png",
				selectedIconPath: "https://s3.dova.link:3001/test/20240220/e31bb18a182b4d3c8e6ab84ad8d06bb0.png",
				text: '活动集锦',
				customIcon: false,
			},
			{
				iconPath: "https://s3.dova.link:3001/test/20240220/2607eaeeb02442c3b874ea3aef469378.png",
				selectedIconPath: "https://s3.dova.link:3001/test/20240220/28afb049143f45ce9b4e4d4d08097c22.png",
				midButton: true,
				customIcon: false,
			},
			{
				iconPath: "https://s3.dova.link:3001/test/20240202/f6aadb3133ae422abc9432b988a21860.png",
				selectedIconPath: "https://s3.dova.link:3001/test/20240202/109394364a164c839cff3730a2da540e.png",
				text: '比赛作品',
				customIcon: false,
			},
			{
				iconPath: "https://s3.dova.link:3001/test/20240205/55db5b4b83904ed09f54b47db3f2b655.png",
				selectedIconPath: "https://s3.dova.link:3001/test/20240205/35f0604f0fcf49a4b2897652f8800c46.png",
				text: '我的',
				// count: 23,  右上角的红色数字
				isDot: false,
				customIcon: false,
			},
			],
			// current: 0,
			pageList: [
				"pages/index",
				"pages/convenience/index",
				"pages/Share/Share",
				"pages/socialWork/index",
				"pages/mine/index",

			]
		}
	},
	methods: {
		tabbarChange(e) {
			// this.current = e
			uni.switchTab({
				url: '/' + this.pageList[e]
			})
		}
	}
}
</script>

<style lang="less"></style>